import request from '@/utils/request'

// 获取周期类型下拉列表
export function getCycleTypeList() {
  return request({
    url: '/operation/web/operationCycleMechanismSetting/cycleTypeList',
    method: 'get'
  })
}

// 获取班次轮换规则下拉列表
export function getShiftRotationRuleList() {
  return request({
    url: '/operation/web/operationCycleMechanismSetting/cycleRotationRuleList',
    method: 'get'
  })
}

// 获取员工分配规则下拉列表
export function getEmployeeAllocationRuleList() {
  return request({
    url: '/operation/web/operationCycleMechanismSetting/employeeAllocationRuleList',
    method: 'get'
  })
}

// 查询周期机制设置列表
export function getCycleMechanismList(params) {
  return request({
    url: '/operation/web/operationCycleMechanismSetting/list',
    method: 'get',
    params
  })
}

// 获取周期机制设置详细信息
export function getCycleMechanismDetail(cycleId) {
  return request({
    url: `/operation/web/operationCycleMechanismSetting/${cycleId}`,
    method: 'get'
  })
}

// 新增周期机制设置
export function addCycleMechanism(data) {
  return request({
    url: '/operation/web/operationCycleMechanismSetting',
    method: 'post',
    data
  })
}

// 修改周期机制设置
export function updateCycleMechanism(data) {
  return request({
    url: '/operation/web/operationCycleMechanismSetting',
    method: 'put',
    data
  })
}

// 删除周期机制设置
export function deleteCycleMechanism(cycleIds) {
  return request({
    url: `/operation/web/operationCycleMechanismSetting/${cycleIds}`,
    method: 'delete'
  })
}